/**
 * Created by hxpeng on 2017/3/24.
 */
(function () {
    'use strict';

    angular.module('App.pages.class')
        .controller('ClassInfoCtrl', ClassInfoCtrl);

    function ClassInfoCtrl($scope,ClassInfoModel,AppUtils,store,MemberModel) {

        $scope.$on('$ionicView.beforeEnter', function (event, viewData) {
            viewData.enableBack = true;
        });

        var vm = this;
        vm.classInfo = {};
        var loginAccount = store.get("loginAccount");
        var memberId = "";
        if(loginAccount.memberType == 2){
            memberId = loginAccount.studentId;
        }else{
            memberId = loginAccount.memberId;
        }

        ClassInfoModel.classInfo({memberId: memberId}).$promise.then(function(response){
            if(response.stat == 'err'){
                AppUtils.showAlert(response.msg);
            }else{
                vm.classInfo = response.schoolClass;
            }
        })

    }

})();
